﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
                    xmlns:scm="clr-namespace:System.ComponentModel;assembly=WindowsBase">

    <Color x:Key="ScrollbarTrackColor">Orange</Color>
    <Color x:Key="ScrollbarThumbFillColor">Orange</Color>

    <Style x:Key="LeftScrollViewer" TargetType="{x:Type ScrollViewer}">
        <Setter Property="OverridesDefaultStyle" Value="True" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollViewer}">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <ScrollContentPresenter Grid.Column="1" Grid.Row="1" />
                        <ScrollBar x:Name="PART_VerticalScrollBar"
                                   Grid.Column="0" Grid.Row="1"
                                   Value="{TemplateBinding VerticalOffset}"
                                   Maximum="{TemplateBinding ScrollableHeight}"
                                   ViewportSize="{TemplateBinding ViewportHeight}"
                                   Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"/>
                        <ScrollBar x:Name="PART_HorizontalScrollBar"
                                   Orientation="Horizontal"
                                   Grid.Row="0"
                                   Grid.Column="1"
                                   Value="{TemplateBinding HorizontalOffset}"
                                   Maximum="{TemplateBinding ScrollableWidth}"
                                   ViewportSize="{TemplateBinding ViewportWidth}"
                                   Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ScrollBarPageButton" TargetType="{x:Type RepeatButton}">
        <Setter Property="OverridesDefaultStyle" Value="true"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Focusable" Value="false"/>
        <Setter Property="IsTabStop" Value="false"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type RepeatButton}">
                    <Rectangle Fill="{TemplateBinding Background}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="HorizontalThumb" TargetType="{x:Type Thumb}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Grid Opacity="0.75">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="1" />
                            <ColumnDefinition Width="1" />
                            <ColumnDefinition />
                            <ColumnDefinition Width="1" />
                            <ColumnDefinition Width="1" />
                        </Grid.ColumnDefinitions>
                        <Rectangle Grid.Column="0" Grid.ColumnSpan="2">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource ScrollbarThumbFillColor}"/>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle Grid.Column="1" Grid.ColumnSpan="3">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource ScrollbarThumbFillColor}"/>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle Grid.Column="3" Grid.ColumnSpan="2">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource ScrollbarThumbFillColor}"/>
                            </Rectangle.Fill>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="VerticalThumb" TargetType="{x:Type Thumb}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Thumb}">
                    <Grid Opacity="0.50">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="1" />
                            <RowDefinition Height="1" />
                            <RowDefinition />
                            <RowDefinition Height="1" />
                            <RowDefinition Height="1" />
                        </Grid.RowDefinitions>
                        <Rectangle Grid.Row="0" Grid.RowSpan="2">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource ScrollbarThumbFillColor}"/>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle Grid.Row="1" Grid.RowSpan="3">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource ScrollbarThumbFillColor}"/>
                            </Rectangle.Fill>
                        </Rectangle>
                        <Rectangle Grid.Row="3" Grid.RowSpan="2">
                            <Rectangle.Fill>
                                <SolidColorBrush Color="{StaticResource ScrollbarThumbFillColor}"/>
                            </Rectangle.Fill>
                        </Rectangle>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type ScrollBar}">
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/>
        <Setter Property="Stylus.IsFlicksEnabled" Value="false"/>
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
        <Setter Property="Width" Value="2"/>
        <Setter Property="MinWidth" Value="2"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ScrollBar}">
                    <Border x:Name="Bg" CornerRadius="0" SnapsToDevicePixels="true">
                        <Border.Background>
                            <SolidColorBrush Color="{StaticResource ScrollbarTrackColor}" Opacity="0.15" />
                        </Border.Background>
                        <Track x:Name="PART_Track" IsDirectionReversed="true" IsEnabled="{TemplateBinding IsMouseOver}" Grid.Row="1">
                            <Track.DecreaseRepeatButton>
                                <RepeatButton Command="{x:Static ScrollBar.PageUpCommand}" Style="{StaticResource ScrollBarPageButton}"/>
                            </Track.DecreaseRepeatButton>
                            <Track.IncreaseRepeatButton>
                                <RepeatButton Command="{x:Static ScrollBar.PageDownCommand}" Style="{StaticResource ScrollBarPageButton}"/>
                            </Track.IncreaseRepeatButton>
                            <Track.Thumb>
                                <Thumb Style="{DynamicResource VerticalThumb}" Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="VerticalGripper" Width="8"/>
                            </Track.Thumb>
                        </Track>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="Orientation" Value="Horizontal">
                <Setter Property="Width" Value="Auto"/>
                <Setter Property="MinWidth" Value="0"/>
                <Setter Property="Height" Value="2"/>
                <Setter Property="MinHeight" Value="2"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ScrollBar}">
                            <Grid x:Name="Bg" SnapsToDevicePixels="true">
                                <Grid.Background>
                                    <SolidColorBrush Color="{StaticResource ScrollbarTrackColor}" Opacity="0.15" />
                                </Grid.Background>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="0.00001*"/>
                                </Grid.ColumnDefinitions>
                                <Track x:Name="PART_Track" Grid.Column="1" IsEnabled="{TemplateBinding IsMouseOver}">
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton Command="{x:Static ScrollBar.PageLeftCommand}" Style="{StaticResource ScrollBarPageButton}"/>
                                    </Track.DecreaseRepeatButton>
                                    <Track.IncreaseRepeatButton>
                                        <RepeatButton Command="{x:Static ScrollBar.PageRightCommand}" Style="{StaticResource ScrollBarPageButton}"/>
                                    </Track.IncreaseRepeatButton>
                                    <Track.Thumb>
                                        <Thumb Microsoft_Windows_Themes:ScrollChrome.ScrollGlyph="HorizontalGripper" Style="{DynamicResource HorizontalThumb}" Height="8"/>
                                    </Track.Thumb>
                                </Track>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>